home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7189 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What's your compiler's answer?
  5. Date: 17 Feb 96 22:25:45 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.824595945@rscernix>
  8. References: <1996Feb7.140945.28351@cs.rit.edu> <4fq0cq$h9s@hpbblb.bbn.hp.com> <danpop.824432113@rscernix> <4g2a1d$r33@solutions.solon.com>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <4g2a1d$r33@solutions.solon.com> seebs@solutions.solon.com (Peter Seebach) writes:
  13.  
  14. >In article <danpop.824432113@rscernix>, Dan Pop <danpop@mail.cern.ch> wrote:
  15. >>j = i++, i++, i++;     /* equivalent to: j = i + 2; i += 3; */
  16. >
  17. >Don't you mean "/* equivalent to: j = i; i += 3; */"?
  18.  
  19. Right.
  20.  
  21. >(And, of course, it's not equivalent if i is volatile.)
  22.  
  23. I can be pedantic as well: the semantics of "volatile" WRT the ++ operator
  24. are implementation defined :-)  An implementation is free to replace
  25. i++, i++, i++ by i += 3, _even_ if i is volatile.
  26.  
  27. >>If you have any objections to any of these examples, please read the FAQ
  28. >>before expressing them in the newsgroup.
  29. >
  30. >I can't seem to find mine, but I'm pretty sure that comma binds later than
  31. >assignment, or however you say it.  (Not "comma has lower precedence" - C
  32. >has no precedence, although it may act convincingly like it does.)
  33.  
  34. If it quacks like a duck...
  35.  
  36. The behaviour of the C operators _can_ be described in terms of precedence
  37. and associativity and K&R decided to do so.  If it was good enough for 
  38. them...
  39.  
  40. Dan
  41. --
  42. Dan Pop
  43. CERN, CN Division
  44. Email: danpop@mail.cern.ch 
  45. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  46.